package xyz.starter.cfg;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import xyz.starter.service.Service;

/**
 * @Configuration
 * @ConditionalOnClass
 * @@EnableConfigurationProperties 使 @ConfigurationProperties 注解的类生效
 *
 */


@Configuration
@ConditionalOnClass(Service.class)
@EnableConfigurationProperties(Properties.class)
public class AutoConfig {

    @Autowired
    private Properties properties;

    Service service(){
        Service service1 = new Service();
        service1.setProperties(properties);
        return new Service();
    }

}
